Ext.define('App.lib.UploadMultiSelectWindow', {
	extend : 'App.config.BaseWindow',
	xtype : 'uploadMultiSelectWindow',
    id:"uploadMultiSelectWindow",
	layout : 'anchor',
	title:"请选择上传文件",
	buttons:[
	         {
	        	 text:"上传",
	        	 action:"save"
	         },
	              {
	        	 text:"关闭", handler:function(btn){
	        			btn.up("window").close();
	        	 }
	        	 
	         },
	         
	         
	         ],
	items:[{
		xtype:"panel",
		itemId:"imagesPanel",
		autoScroll : true,
		layout:"anchor",
		height:200,
		listeners: {
			 'beforeadd':function(st,str,obj){
					var grid = Ext.ComponentQuery.query('panel [itemId=imagesPanel]');
					var d = grid[0].body.dom;
					d.scrollTop = d.scrollHeight - d.offsetHeight;
	          }
	        }
	},{
		xtype:"form",
		layout:"form",
		enctype : "multipart/form-data",
		items:[{
			xtype:"filefield",
			fieldLabel : "文件",
			name : "files",
			allowBlank : false,
            listeners: {
                afterrender: function(me){
                    App.lib.renderer(me);

                },
                change: function(me){
                    App.lib.renderer(me);
                }

            }
		},{
		    xtype:"hidden",
            itemId:"files"
        }]
	}
]
});
App.lib.renderer = function(compent){
    var typeArray = ["application/x-shockwave-flash","audio/MP3","image/*","application/vnd.ms-excel","application/msword","flv-application/octet-stream,text/plain"];

    var fileDom = compent.getEl().down('input[type=file]');

    fileDom.dom.setAttribute("multiple","multiple");

    fileDom.dom.setAttribute("accept",typeArray.join(","));
}